$(function(){
	var uName = $.cookie("youleche.u");
	if(uName != null){
		$("#divLogin").html('');
		$("#divLogin").html("<span style=\"color:#666;font-size:12px;\">欢迎你，</span><a  onclick=\"myMeile();\" style=\"cursor:pointer;color:#3CAC7E;font-size:16px;\">" +uName +"</a>&nbsp;&nbsp;<span style=\"color:#ccc;font-size:12px;\">|</span>&nbsp;&nbsp;<a  onclick=\"myMeile();\" style=\"cursor:pointer;color:#666;font-size:12px;\">我的美乐车</a>");
	}
	
	AreaSelector().init();
	shangmenFuwuCheckBtnLiveEvent();
});



function shangmenFuwuCheckBtnLiveEvent(){
	$("#chk1fw").live("change",function(){
		if($("#chk1fw").attr("checked") == "checked"){
			$("#chk0fw").removeAttr("checked");
		}else{
			$("#chk0fw").attr("checked", "checked");
		}
		
	});
	
	$("#chk0fw").live("change",function(){
		if($("#chk0fw").attr("checked") == "checked"){
			$("#chk1fw").removeAttr("checked");
		}else{
			$("#chk1fw").attr("checked", "checked");
		}
		
	});
}
function myMeile(){
	var u = $.cookie("youleche.u");
	if(u == null){
		window.location.href = "login.jsp";
	}else{
		$.ajax({
			type : 'post',
			dataType : 'text',
			contentType : "application/json",
    		url: "login.do",
    		success: function(v){
    			if(v == "true"){
    				window.location.href = "user/index.jsp";
    			}else{
    				window.location.href = "login.jsp";
    			}
    		}
		});
	}
}

function releaseOther(){
	window.location.href="list.jsp";
}

function teachMe(){
	var title = "成都修理自行车、电动车";
	if($("#chk0fw").attr("checked") == "checked"){
		title += ",每天8:00-20:00提供上门服务";
	}
	
	if($("#txtlinkPhoneNum").val() != ""){
		title += ",联系电话 " +$("#txtlinkPhoneNum").val() ;
	}
	
	$("#infoTitle").val(title);
	
	var fixType = "";
	if($("#chk0fw").attr("checked") == "checked"){
		fixType = "上门服务";
	}else{
		fixType = "店铺修理";
	}
	
	var content = "修理方式："+fixType+"\n";
	content += "修理机械：电动车、自行车\n";
	content += "修理描述：";
	
	$("#fixDescrible").val(content);
	
}